﻿create table "Course"
(
    "Id" integer primary key,
	"Name" varchar2(100),
	"Code" varchar2(100),
	"Description" varchar2(1000)
);
create table "CourseSelection"
(
    "Id" integer primary key,
	"Student" integer,
	"Course" integer,
	"Trimester" integer,
	"SelectDate" date,
	"Score" integer,
	"Cancelled" number(1)
);
create table "Gender"
(
    "Id" integer primary key,
	"Name" varchar2(100),
	"Abbreviation" varchar2(100)
);
create table "ScoreLevel"
(
    "Id" integer primary key,
	"Name" varchar2(100),
	"Description" varchar2(100),
	"LowBound" integer,
	"UpBound" integer
);
create table "Student"
(
    "Id" integer primary key,
	"FirstName" varchar2(100),
	"LastName" varchar2(100),
	"StudentId" varchar2(100),
	"Birthday" date,
	"Gender" integer,
	"Email" varchar2(100),
	"DayPhone" varchar2(100),
	"NightPhone" varchar2(100),
	"Address" varchar2(100),
	"Picture" blob
);
create table "Teacher"
(
    "Id" integer primary key,
	"Trimester" integer,
	"Course" integer,
	"Tutor" integer
);
create table "Trimester"
(
    "Id" integer primary key,
	"Name" varchar2(100),
	"Abbreviation" varchar2(100),
	"StartDate" date,
	"EndDate" date
);
create table "Tutor"
(
    "Id" integer primary key,
	"FirstName" varchar2(100),
	"LastName" varchar2(100),
	"Gender" integer,
	"TutorLevel" integer
);
create table "TutorLevel"
(
    "Id" integer primary key,
	"Name" varchar2(100),
	"Abbreviation" varchar2(100)
);
create table "ClassA"
(
    "Id" integer primary key,
    "BOOL" number(1),
    "INT" integer,
    "STRING" varchar2(100),
    "IMAGE" blob,
    "DATETIME" date,
    "DECIMAL" number(18,2),
    "ClassBId" integer,
    "ClassBId2" integer,
    "ClassDId" integer
);
create table "ClassB"
(
    "Id" integer primary key,
    "BOOL" number(1),
    "INT" integer,
    "STRING" varchar2(100),
    "IMAGE" blob,
    "DATETIME" date,
    "DECIMAL" number(18,2),
    "ClassBId" integer
);
create table "ClassD"
(
    "Id" integer primary key,
    "BOOL" number(1),
    "INT" integer,
    "STRING" varchar2(100),
    "IMAGE" blob,
    "DATETIME" date,
    "DECIMAL" number(18,2),
    "ClassEId" integer
);
create table "ClassE"
(
    "Id" integer primary key,
    "BOOL" number(1),
    "INT" integer,
    "STRING" varchar2(100),
    "IMAGE" blob,
    "DATETIME" date,
    "DECIMAL" number(18,2),
    "ClassDId" integer
);

DROP SEQUENCE Course_Sequence;
CREATE SEQUENCE Course_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE Gender_Sequence;
CREATE SEQUENCE Gender_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE Gender_Sequence;
CREATE SEQUENCE Gender_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE ScoreLevel_Sequence;
CREATE SEQUENCE ScoreLevel_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE Student_Sequence;
CREATE SEQUENCE Student_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE Teacher_Sequence;
CREATE SEQUENCE Teacher_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE Trimester_Sequence;
CREATE SEQUENCE Trimester_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE Tutor_Sequence;
CREATE SEQUENCE Tutor_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE TutorLevel_Sequence;
CREATE SEQUENCE TutorLevel_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE ClassA_Sequence;
CREATE SEQUENCE ClassA_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE ClassB_Sequence;
CREATE SEQUENCE ClassB_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE ClassD_Sequence;
CREATE SEQUENCE ClassD_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
DROP SEQUENCE ClassE_Sequence;
CREATE SEQUENCE ClassE_Sequence INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE CACHE 10; 
     
--create trigger one by one.
CREATE OR REPLACE TRIGGER Course_Trigger BEFORE INSERT ON "Course" for each row BEGIN SELECT Course_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER CourseSelection_Trigger BEFORE INSERT ON "CourseSelection" for each row BEGIN SELECT CourseSelection_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER Gender_Trigger BEFORE INSERT ON "Gender" for each row BEGIN SELECT Gender_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER ScoreLevel_Trigger BEFORE INSERT ON "ScoreLevel" for each row BEGIN SELECT ScoreLevel_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER Student_Trigger BEFORE INSERT ON "Student" for each row BEGIN SELECT Student_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER Teacher_Trigger BEFORE INSERT ON "Teacher" for each row BEGIN SELECT Teacher_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER Trimester_Trigger BEFORE INSERT ON "Trimester" for each row BEGIN SELECT Trimester_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER Tutor_Trigger BEFORE INSERT ON "Tutor" for each row BEGIN SELECT Tutor_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER TutorLevel_Trigger BEFORE INSERT ON "TutorLevel" for each row BEGIN SELECT TutorLevel_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER ClassA_Trigger BEFORE INSERT ON "ClassA" for each row BEGIN SELECT ClassA_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER ClassB_Trigger BEFORE INSERT ON "ClassB" for each row BEGIN SELECT ClassB_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER ClassD_Trigger BEFORE INSERT ON "ClassD" for each row BEGIN SELECT ClassD_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;

CREATE OR REPLACE TRIGGER ClassE_Trigger BEFORE INSERT ON "ClassE" for each row BEGIN SELECT ClassE_Sequence.NEXTVAL INTO :NEW."Id" FROM DUAL; END;


insert into "Course"("Name", "Code", "Description") values(
'Introduction to Computer Program Design', 
'COMP 102', 
'This course introduces the fundamentals of programming in a high-level programming language (Java), using an object oriented approach to program design. Students develop their programming skills by constructing computer programs for a variety of applications. The course provides a foundation for all later courses in computer science, and develops programming skills useful for students in many other disciplines.'
);
insert into "Course"("Name", "Code", "Description") values(
'Introduction to Data Structures and Algorithms', 
'COMP 103', 
'This course builds on COMP 102, focusing on the techniques for designing, building and analysing computer programs that deal with large collections of data. The course addresses techniques for programming with collections of data, and the data structures and algorithms needed to implement these collections. The course expands programming skills and provides an understanding of the principles of data abstraction, algorithm design, and the analysis of algorithms fundamental to computer science.'
);
insert into "Course"("Name", "Code", "Description") values(
'Introduction to Computer Science', 
'COMP 112', 
'This course introduces a range of important concepts and topics across Computer Science, Software Engineering and Network Engineering. Students will also gain a solid foundation of programming skills in object oriented programming. The course is an entry point to the BE(Hons) and BSc in Computer Science for students who already have basic programming skills.'
);
insert into "Course"("Name", "Code", "Description") values(
'Engineering Technology', 
'ENGR 101', 
'This course provides a general introduction to the fundamental technical concepts needed to understand the design and engineering of electronic, mechatronic, networked and software systems. Experience is gained in basic engineering practice, with assembly and testing of basic hardware, software and networked systems, and construction of a personal computer.'
);
insert into "Course"("Name", "Code", "Description") values(
'Engineering Modelling and Design', 
'ENGR 110', 
'This course introduces the role of modelling in the engineering design process. Different modelling techniques will be presented and techniques for evaluating each that can aid design decisions will be demonstrated. Practical work will support the learning of different modelling and simulation techniques.'
);
insert into "Course"("Name", "Code", "Description") values(
'Algorithms and Data Structures', 
'COMP 261', 
'This course covers a range of algorithms and data structures building on the fundamental structures and algorithms from COMP 103. The major areas covered are: graph algorithms, graphics algorithms and advanced data structures. This course takes a practical approach focusing on the implementation of a wide variety of algorithms.'
);
insert into "Course"("Name", "Code", "Description") values(
'Data Acquisition', 
'ECEN 201', 
'The course provides an introduction into the acquisition and analysis of engineering and scientific data and signals by means of data acquisition systems. Topics covered include the principle of operation and characteristics of sensors, signal conditioning, analogue to digital and digital to analogue conversion, sampling, I/O techniques and databases, the interfacing of both personal computers and microcontrollers using appropriate software.'
);
insert into "Course"("Name", "Code", "Description") values(
'Digital Electronics', 
'ECEN 202', 
'A practically oriented introduction to the design and construction of digital electronic instruments. The course provides a foundation in binary arithmetic and Boolean algebra, logic gates and families, combinational and sequential logic design, programmable logic and digital-to-analogue conversion.'
);
insert into "Course"("Name", "Code", "Description") values(
'Analogue Circuits and Systems', 
'ECEN 203', 
'This course is a practically oriented introduction to analogue electronics. Topics covered include circuit theorems, transducers, power supplies, transistor amplifiers, operational amplifiers and circuits.'
);
insert into "Course"("Name", "Code", "Description") values(
'Signals and Systems', 
'ECEN 220', 
'The course introduces analysis techniques for signals and linear time-invariant systems as well as fundamentals of probability, statistics and random variables. It includes Laplace and Fourier transform techniques, with applications to circuit analysis, electromechanical systems and communication theory. The course also introduces concepts of probability density, functions of random variables and statistical tests.'
);
insert into "Course"("Name", "Code", "Description") values(
'Work Experience Preparation', 
'ENGR 291', 
'A range of activities in preparation for the work experience requirement for the BE(Hons).'
);
insert into "Course"("Name", "Code", "Description") values(
'Systems Programming', 
'NWEN 241', 
'This course considers the issues raised when programming at a low-level. for example in embedded systems, OS system level, or network protocol stacks. Topics include: an introduction to C and C++ language programming; and higher- level systems programming using scripting languages. It will include motivating examples related to a wide variety of applications of system programming.'
);
insert into "Course"("Name", "Code", "Description") values(
'Computer Organisation', 
'NWEN 242', 
'The course develops an understanding of the structure of computers and how they are to execute programmes. The course introduces the fundamentals of assembly language programming, data representation and computer arithmetic. It then develops an understanding of microprocessor architecture at the hardware level. Topics include digital electronics, arithmetic and logic unit (ALU), data paths, pipelining, memory hierarchy, I/O and motivating examples of computer systems. Students are recommended, but not required, to have some familiarity with C programming prior to taking this course.'
);
insert into "Course"("Name", "Code", "Description") values(
'Network Applications', 
'NWEN 243', 
'The course provides a broad introduction to computer networks and a basic understanding of network application programming, with an emphasis on the working principles and application of computer networks. It covers a range of topics including basic data communication and computer network concepts, protocols, networked computing concepts and principles, network applications development and network security. The course features an interactive laboratory component with projects examining modern networking technologies such as, GPS enabled mobile phone applications, multimedia and distributed applications. Students are recommended, but not required, to have some familiarity with C programming prior to taking this course.'
);
insert into "Course"("Name", "Code", "Description") values(
'Software Development', 
'SWEN 221', 
'This course develops a deeper understanding of object- oriented programming and associated practices. The focus is on programming techniques at the micro scale. Topics include: inheritance, polymorphism, genericity, error handling, testing and debugging. A sequence of short assignments will develop the key ideas and practices; rigour in testing will be developed through (automated) assessment of programme correctness.'
);
insert into "Course"("Name", "Code", "Description") values(
'Software Design', 
'SWEN 222', 
'This course develops a deeper understanding of object- oriented design. In particular, students will be expected to design and implement several large programs from scratch by working together in groups. Thefocus of this course is programming techniques at the macro scale.'
);
insert into "Course"("Name", "Code", "Description") values(
'Software Engineering Analysis', 
'SWEN 223', 
'This course provides a working knowledge of analysis and design methods found in modern software engineering systems. Topics include the analysis tools and techniques of the software engineer, the process of analysis and object- oriented analysis and design. Students will complete project work using UML and OCL, using modern Computer Aided Software Engineering (CASE) toolsets.'
);
insert into "Course"("Name", "Code", "Description") values(
'Formal Foundations of Programming', 
'SWEN 224', 
'This course introduces a selection of topics, focusing on the use of formal notations and formal models in the specification, design and analysis and engineering of programs, languages and machines. Topics covered will include finite state machines, formal languages and grammars, operational semantics, and specifying and analysing systems using software tools for formal specification.'
);

insert into "Gender"("Name", "Abbreviation") 
values('Male', 'M');
insert into "Gender"("Name", "Abbreviation") 
values('Female', 'F');
insert into "Gender"("Name", "Abbreviation") 
values('Transgender', 'T');

insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('A+', 'Excellent+', 91, 99);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('A', 'Excellent', 81, 90);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('A-', 'Excellent-', 71, 80);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('B+', 'Good+', 66, 70);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('B', 'Good', 61, 65);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('B-', 'Good-', 56, 60);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('C+', 'Satisfied+', 51, 55);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('C', 'Satisfied', 50, 50);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('C-', 'Satisfied-', 31, 49);
insert into "ScoreLevel"("Name", "Description", "LowBound", "UpBound") 
values('D', 'Common', 1, 30);

insert into "Trimester"("Name", "Abbreviation", "StartDate", "EndDate") 
values('2014 T1', '2014T1', to_date('2014-02-01', 'yyyy-mm-dd'), to_date('2014-06-30', 'yyyy-mm-dd'));
insert into "Trimester"("Name", "Abbreviation", "StartDate", "EndDate") 
values('2014 T2', '2014T2', to_date('2014-07-01', 'yyyy-mm-dd'), to_date('2014-10-31', 'yyyy-mm-dd'));
insert into "Trimester"("Name", "Abbreviation", "StartDate", "EndDate") 
values('2014 T3', '2014T3', to_date('2014-11-20', 'yyyy-mm-dd'), to_date('2015-01-20', 'yyyy-mm-dd'));

insert into "TutorLevel"("Name", "Abbreviation") 
values ('Tutor', 'Tutor');
insert into "TutorLevel"("Name", "Abbreviation") 
values ('Teacher', 'Teacher');
insert into "TutorLevel"("Name", "Abbreviation") 
values ('Director', 'Director');
insert into "TutorLevel"("Name", "Abbreviation") 
values ('Doctor', 'Doctor');
insert into "TutorLevel"("Name", "Abbreviation") 
values ('Professor', 'Professor');



insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Dominick', 'Johnson', to_date('1990-01-01', 'yyyy-mm-dd'), 'Johnson.Dominick@gmail.com', '021 1234567', '021 1234567', 'Onehunga, Auckland', '300123001', 1);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Ronie', 'Colemen', to_date('1990-02-01', 'yyyy-mm-dd'), 'Ronie.Colemen@gmail.com', '021 2345678', '021 2345678', 'Epsom, Auckland', '300123002', 1);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Bill', 'Henderson', to_date('1990-03-01', 'yyyy-mm-dd'), 'Bill.Henderson@gmail.com', '021 3456789', '021 3456789', 'Roshill, Auckland', '300123003', 1);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Taylor', 'Fenn', to_date('1990-04-01', 'yyyy-mm-dd'), 'Taylor.Fenn@gmail.com', '027 9876543', '027 9876543', 'Karori, Wellington', '300123004', 2);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Alice', 'Arroyo', to_date('1990-03-10', 'yyyy-mm-dd'), 'Alice.Arroyo@gmail.com', '027 8765432', '027 8765432', 'Kelburn, Wellington', '300123005', 2);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Mary', 'Bangert', to_date('1990-04-10', 'yyyy-mm-dd'), 'Mary.Bangert@gmail.com', '022 1472589', '022 1472589', 'Newtown, Wellington', '300123006', 2);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Joey', 'Tribiani', to_date('1989-07-21', 'yyyy-mm-dd'), 'Joey.Tribiani@gmail.com', '022 9635551', '022 9635551', 'Thordon, Wellington', '300123007', 1);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Pheebe', 'Buffey', to_date('1991-08-17', 'yyyy-mm-dd'), 'Pheebe.Buffey@gmail.com', '021 8521599', '021 8521599', 'Karori, Wellington', '300123008', 2);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Ross', 'Geller', to_date('1988-01-21', 'yyyy-mm-dd'), 'Ross.Geller@gmail.com', '027 1122334', '027 1122334', 'Onehunga, Auckland', '300123009', 1);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Rachal', 'White', to_date('1990-11-11', 'yyyy-mm-dd'), 'Rachal.White@gmail.com', '022 9988776', '022 9988776', 'Onehunga, Auckland', '300123010', 2);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Monica', 'Geller', to_date('1990-05-28', 'yyyy-mm-dd'), 'Monica.Geller@gmail.com', '021 7788991', '021 7788991', 'Roshill, Auckland', '300123011', 2);
insert into "Student"("FirstName", "LastName", "Birthday", "Email", "DayPhone", "NightPhone", "Address", "StudentId", "Gender") 
values('Chandler', 'Black', to_date('1988-02-22', 'yyyy-mm-dd'), 'Chandler.Black@gmail.com', '025 1357924', '025 1357924', 'Epsom, Auckland', '300123012', 1);


insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Mike', 'Wilson', 1, 5);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('David', 'Harper', 1, 5);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Susan', 'Schenk', 2, 1);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Vivian', 'Wei', 2, 1);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Johan', 'Barnard', 1, 2);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Anna', 'Cramp', 2, 4);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('John', 'Hine', 1, 2);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Mengjie', 'Zhang', 1, 4);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Keith', 'Willett', 1, 5);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Lissa', 'Harrop', 2, 3);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Libby', 'Kelly', 1, 5);
insert into "Tutor"("FirstName", "LastName", "Gender", "TutorLevel") 
values('Suzan', 'Hall', 2, 3);

insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 1, 2);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 2, 3);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 3, 4);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 4, 2);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 5, 5);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 6, 8);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 7, 12);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 8, 11);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 9, 6);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 10, 9);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 11, 10);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 12, 7);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 13, 1);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 14, 6);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 15, 9);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 16, 12);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 17, 10);
insert into "Teacher"("Trimester", "Course", "Tutor") 
values(1, 18, 2);


insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(1, 1, 1, to_date('2013-01-01', 'yyyy-mm-dd'), 3, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(1, 2, 1, to_date('2013-01-01', 'yyyy-mm-dd'), null, 1);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(1, 3, 1, to_date('2013-01-01', 'yyyy-mm-dd'), 3, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(2, 1, 1, to_date('2013-01-02', 'yyyy-mm-dd'), 2, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(2, 2, 1, to_date('2013-01-02', 'yyyy-mm-dd'), 1, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(3, 4, 1, to_date('2013-01-01', 'yyyy-mm-dd'), 5, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(3, 5, 1, to_date('2013-01-01', 'yyyy-mm-dd'), 5, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(3, 6, 1, to_date('2013-01-01', 'yyyy-mm-dd'), null, 1);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(4, 5, 1, to_date('2013-01-03', 'yyyy-mm-dd'), 4, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(4, 6, 1, to_date('2013-01-04', 'yyyy-mm-dd'), 6, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(6, 7, 1, to_date('2013-01-01', 'yyyy-mm-dd'), 2, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(7, 7, 1, to_date('2013-01-02', 'yyyy-mm-dd'), 6, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(7, 8, 1, to_date('2013-01-03', 'yyyy-mm-dd'), 7, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(8, 8, 1, to_date('2013-01-01', 'yyyy-mm-dd'), null, 1);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(9, 2, 1, to_date('2013-01-02', 'yyyy-mm-dd'), 3, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(9, 3, 1, to_date('2013-01-02', 'yyyy-mm-dd'), 5, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(10, 8, 1, to_date('2013-01-03', 'yyyy-mm-dd'), 8, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(10, 9, 1, to_date('2013-01-03', 'yyyy-mm-dd'), 5, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(10, 10, 1, to_date('2013-01-04', 'yyyy-mm-dd'), 4, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(11, 11, 1, to_date('2013-01-01', 'yyyy-mm-dd'), 6, 0);
insert into "CourseSelection"("Student", "Course", "Trimester", "SelectDate", "Score", "Cancelled") 
values(11, 12, 1, to_date('2013-01-01', 'yyyy-mm-dd'), 3, 0);


insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,11,'B1', to_date('2013-01-01', 'yyyy-mm-dd'), 1.01, NULL);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,12,'B2', to_date('2013-01-01', 'yyyy-mm-dd'), 2.01, 1);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,13,'B3', to_date('2013-01-01', 'yyyy-mm-dd'), 3.01, 2);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,14,'B4', to_date('2013-01-01', 'yyyy-mm-dd'), 4.01, 3);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,15,'B5', to_date('2013-01-01', 'yyyy-mm-dd'), 5.01, 4);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,16,'BB1', to_date('2013-01-01', 'yyyy-mm-dd'), 6.01, NULL);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,17,'BB2', to_date('2013-01-01', 'yyyy-mm-dd'), 7.01, 6);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,18,'BB3', to_date('2013-01-01', 'yyyy-mm-dd'), 8.01, 7);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,19,'BB4', to_date('2013-01-01', 'yyyy-mm-dd'), 9.01, 8);
insert into "ClassB"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId") 
VALUES(1,20,'BB5', to_date('2013-01-01', 'yyyy-mm-dd'), 10.01, 9);




insert into "ClassA"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId", "ClassBId2", "ClassDId") 
VALUES(1, 10, 'A', to_date('2013-01-01', 'yyyy-mm-dd'), 10.01, 1, 6, NULL);
insert into "ClassA"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId", "ClassBId2", "ClassDId") 
VALUES(0, 20, 'BB', to_date('2014-01-01', 'yyyy-mm-dd'), 20.01, NULL,NULL, NULL);
insert into "ClassA"("BOOL", "INT", "STRING", "DATETIME", "DECIMAL", "ClassBId", "ClassBId2", "ClassDId") 
VALUES(0, 20, 'CC', to_date('2014-01-01', 'yyyy-mm-dd'), 20.01, 1,NULL, NULL);



commit;